package com.yunji.ylexpiration.service.impl;

import com.yunji.ylexpiration.entity.FurnAddresstable;
import com.yunji.ylexpiration.entity.FurnAddresstableExample;
import com.yunji.ylexpiration.mapper.FurnAddresstableMapper;
import com.yunji.ylexpiration.service.AddaddressService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AddaddressServiceimpl implements AddaddressService {
    @Resource
    private FurnAddresstableMapper furnAddresstableMapper;
    @Override
    public int insertSelective(FurnAddresstable record) {
        int address=furnAddresstableMapper.insertSelective(record);
        return address;
    }

    @Override
    public List<FurnAddresstable> seleuid(Integer userId) {
        FurnAddresstableExample example = new FurnAddresstableExample();
        FurnAddresstableExample.Criteria criteria = example.createCriteria();
        criteria.andUserIdEqualTo(userId);
        List<FurnAddresstable> furnAddresstables = furnAddresstableMapper.selectByExample(example);
        return furnAddresstables;
    }

    @Override
    public int deleteByPrimaryKey(Integer id) {
        int count=furnAddresstableMapper.deleteByPrimaryKey(id);
        return count;
    }

    @Override
    public int updateByPrimaryKeySelective(FurnAddresstable record) {
        int upcout=furnAddresstableMapper.updateByPrimaryKeySelective(record);
        return upcout;
    }


}
